var Adv_skd=require("./Adv_skd")

var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2pvzChannel = require("pvzChannel");
var $2AudioManager = require("AudioManager");
var $2DataManager = require("DataManager");
var $2UIManager = require("UIManager");
var $2KDefine = require("KDefine");
var $2SharePanelUI = require("SharePanelUI");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_FailUI = /* */function (_cc$Component20) {
  babel_inherits(u, _cc$Component20);
  var _super22 = babel_createSuper(u);
  function u() {
    babel_classCallCheck(this, u);
    return _super22.apply(this, arguments);
  }
  babel_createClass(u, [{
    key: "onLoad",
    value: function onLoad() {
        Adv_skd.default.instance.hideAllAdv();
              Adv_skd.default.instance.showInterstitialAd();
              Adv_skd.default.instance.showGridAdLeft();
              Adv_skd.default.instance.showGridAdRight();
              Adv_skd.default.instance.showGridAdTop();

      $2DataManager.default.instance.clearTempData();
      $2AudioManager.default.instance.playMusic($2KDefine.AudioName.FailBgm);
      this.initPlatform();
    }
  }, {
    key: "initPlatform",
    value: function initPlatform() {
      $2pvzChannel.pvzChannel.instance().channel.indexOf("wx") >= 0 && $2pvzChannel.pvzChannel.instance().showBanner();
      if ("tt" === $2pvzChannel.pvzChannel.instance().channel) {
        $2pvzChannel.pvzChannel.instance().recorderStop();
        $2UIManager.default.instance.openUI("SharePanelUI", 40).getComponent($2SharePanelUI.default).init(0);
        $2pvzChannel.pvzChannel.instance().showInter();
      }
    }
  }, {
    key: "onClickRestartBtn",
    value: function onClickRestartBtn() {
      Adv_skd.default.instance.hideAllAdv();

      $2UIManager.default.instance.closeUI("FailUI");
      $2UIManager.default.instance.openUI("MainUI");
    }
  }, {
    key: "onClickBackHomeBtn",
    value: function onClickBackHomeBtn() {
      Adv_skd.default.instance.hideAllAdv();

      $2UIManager.default.instance.closeUI("FailUI");
      $2UIManager.default.instance.openUI("MenuUI");
      if ($2pvzChannel.pvzChannel.instance().channel.indexOf("wx") >= 0) {
        $2pvzChannel.pvzChannel.instance().getCtrl("p2") && $2pvzChannel.pvzChannel.instance().showInter();
        var _e25 = $2pvzChannel.pvzChannel.instance().getCtrl("p8");
        _e25 && $2pvzChannel.pvzChannel.instance().startAdTimeCount(_e25, function () {
          $2pvzChannel.pvzChannel.instance().showVideo({
            sucCall() {},
            failCall() {},
            endCall() {}
          });
        }, true);
      }
    }
  }, {
    key: "onClickUpgradeBtn",
    value: function onClickUpgradeBtn() {
      Adv_skd.default.instance.hideAllAdv();

      $2UIManager.default.instance.closeUI("FailUI");
      $2UIManager.default.instance.openUI("MenuUI").opacity = 0;
      $2UIManager.default.instance.openUI("UpgradeUI");
    }
  }, {
    key: "onDestroy",
    value: function onDestroy() {
      $2pvzChannel.pvzChannel.instance().channel.indexOf("wx") >= 0 && $2pvzChannel.pvzChannel.instance().closeBanner();
    }
  }]);
  return u;
}(cc.Component);
def_FailUI = cc__decorate([ccp_ccclass], def_FailUI);
exports.default = def_FailUI;